<script setup>
import { defineOptions, ref, defineModel, inject } from 'vue'
import GeneratorConfig from '@/views/dialog/components/GeneratorConfig.vue'
import EjsTemplate from '@/views/dialog/components/EjsTemplate.vue'
import TypeMapping from '@/views/dialog/components/TypeMapping.vue'

const showConfig = defineModel('showConfig')
const closeDialog = inject('closeDialog')
const activeTab = ref('config')
defineOptions({
  name: 'ConfigDialog'
})
const handleTabClick = () => {
  // todo tab切换事件
}
</script>
<template>
  <el-dialog
      v-model="showConfig"
      width="90%"
      :before-close="closeDialog"
  >
    <el-tabs v-model="activeTab" @tab-click="handleTabClick">
      <el-tab-pane label="生成器配置" name="config">
        <generator-config/>
      </el-tab-pane>
      <el-tab-pane label="数据库配置" name="template">
        <ejs-template/>
      </el-tab-pane>
      <el-tab-pane label="类型映射" name="mapping">
        <type-mapping/>
      </el-tab-pane>
    </el-tabs>
  </el-dialog>
</template>
<style></style>
